/** @file image.hpp Image handling and saving
 * Note that display is not implemented and will be handled by the main loop */
#pragma once

#include "core/color.hpp"

/** A 2D image (RGB) */
class Image
{
public:

  /** Width and height */
  int w,h;

  /** The pixel buffer */
  Color* buffer;

  /** The uchar pixel buffer */
  unsigned char* buffer_uchar;

  /** Construct
   * @param W width
   * @param H height */
  Image(const int W, const int H);

  /** Destroy */
  ~Image();

  /** Update the uchar buffer */
  void updateUchar();

  /** Save to a png file
   * @param fname file name to save to */
  void save(const std::string& fname) const;
};
